package com.zhiyou100.crm.service.impl;

import com.zhiyou100.crm.dao.RoleDao;
import com.zhiyou100.crm.service.RoleService;
import com.zhiyou100.crm.pojo.Role;
import com.zhiyou100.crm.util.S_session;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;
@Service("roleServiceImpl")
public class RoleServiceImpl implements RoleService {
//    RoleDao roleDao=new RoleDaoImpl();
    @Autowired
    private RoleDao roleDao;
    @Override
    public List<Role> queryRole() throws IOException {
        List<Role> roles = roleDao.queryRole();
        return roles;
    }

    @Override
    public int deleteRole(int id) throws IOException {
        int a=roleDao.deleteRole(id);
        return a;

    }

    @Override
    public int update(Role role) throws IOException {
        int a = roleDao.update(role);
        return a;
    }

    @Override
    public int insertRole(Role role) throws IOException {
        int a= roleDao.insertRole(role);
        return a;
    }
}
